
var UITank = cc.Node.extend({

    tank : null,
    cellBg : null,

    id : 0,
    cx : 0,
    cy : 0,
    side : 0,

    ctor : function (id, type, side, cx, cy, hp, mhp) {
        this._super();
        this.id = id;

        // 黄黑线
        var sp = cc.Sprite.create('res/ui/UIGarage/bg_cell.png');
        this.addChild(sp);
        this.cellBg = sp;

        // 坦克
        var u = new BattleUnit(id, type, side, 0, 0, hp, mhp);
        //u.showHp(false);
        u.setPosition(0, 0);   //* 位置修正
        this.addChild(u);
        this.tank = u;

        this.setCellPos(cx, cy, side);
    },

    getCellPos : function () {
        return cc.p(this.cx, this.cy);
    },

    // 设置格子坐标
    setCellPos : function (cx, cy, side) {
        this.cx = cx;
        this.cy = cy;
        this.side = side;
        this.setPosition( helper.posCell2Garage(cx, cy, side) );
    },


});



